<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:form id="frmViewEmployee">
        <f:view>
            <p:contextMenu for="dlgViewEmployee">
                <p:menuitem value="New"
                            icon="ui-icon-search"
                            oncomplete="wgCreateRegisterCode.show();"
                            update=":frmCreateRegisterCode:dlgCreateRegisterCode"
                            />
                <p:menuitem value="View Details"
                            icon="ui-icon ui-icon-arrowreturnthick-1-e"
                            oncomplete="wgDetailsEmployee.show();"
                            update=":frmDetailsEmployee:dlgDetailsEmployee"
                            >
                </p:menuitem>
                
                <p:submenu label="Export" icon="ui-icon-extlink">
                    <p:submenu label="All Data">
                        <p:menuitem value="To Excel 2010"  ajax="false"  >
                            <p:dataExporter type="xls" target="dtViewEmployee"  fileName="Employee" />
                        </p:menuitem>
                        <p:menuitem value="To XML" ajax="false" >
                            <p:dataExporter type="xml" target="dtViewEmployee" fileName="Employee"/>
                        </p:menuitem>
                        <p:menuitem value="To PDF" ajax="false" >
                            <p:dataExporter type="pdf" target="dtViewEmployee" fileName="Employee"/>
                        </p:menuitem>
                    </p:submenu>
                    <p:submenu label="All Data in Page">
                        <p:menuitem value="To Excel 2010" ajax="false" >
                            <p:dataExporter type="xls" target="dtViewEmployee" fileName="Employee" pageOnly="true" />
                        </p:menuitem>
                        <p:menuitem value="To XML" ajax="false" >
                            <p:dataExporter type="xml" target="dtViewEmployee" fileName="Employee" pageOnly="true"/>
                        </p:menuitem>
                    </p:submenu>
                </p:submenu>
            </p:contextMenu>
            <p:focus context="dtViewEmployee"/>
            <p:dialog id="dlgViewEmployee"
                      widgetVar="wgViewEmployee"
                      header="Employee Information Management"
                      draggable="true"
                      showEffect="clip"
                      hideEffect="clip">
                <p:dataTable id="dtViewEmployee"
                             value="#{employeeManagement.list}"
                             rowKey="#{item.userId}"
                             selection="#{employeeManagement.selectUsers}"
                             selectionMode="single"
                             var="item"
                             filteredValue="#{employeeManagement.filteredList}"
                             paginator="true"
                             rows="5">


                    <p:column sortBy="#{item.titleOfCourtesy}"
                              filterBy="#{item.titleOfCourtesy}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="TitleOfCourtesy"/>
                        </f:facet>
                        <h:outputText value="#{item.titleOfCourtesy}"/>
                    </p:column>
                    <p:column sortBy="#{item.fristName}"
                              filterBy="#{item.fristName}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="FristName"/>
                        </f:facet>
                        <h:outputText value="#{item.fristName}"/>
                    </p:column>
             

                    <p:column sortBy="#{item.userName}"
                              filterBy="#{item.userName}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="UserName"/>
                        </f:facet>
                        <h:outputText value="#{item.userName}"/>
                    </p:column>




                    <p:column sortBy="#{item.city}"
                              filterBy="#{item.city}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="City"/>
                        </f:facet>
                        <h:outputText value="#{item.city}"/>
                    </p:column>
                    <p:column sortBy="#{item.region}"
                              filterBy="#{item.region}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Region"/>
                        </f:facet>
                        <h:outputText value="#{item.region}"/>
                    </p:column>
                 
                    <p:column sortBy="#{item.mobilePhone}"
                              filterBy="#{item.mobilePhone}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="MobilePhone"/>
                        </f:facet>
                        <h:outputText value="#{item.mobilePhone}"/>
                    </p:column>

                    <p:column sortBy="#{item.email}"
                              filterBy="#{item.email}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Email"/>
                        </f:facet>
                        <h:outputText value="#{item.email}"/>
                    </p:column>

                    <p:column sortBy="#{item.isLock}"
                              filterBy="#{item.isLock}"
                              filterOptions="#{employeeManagement.lockOption}"
                              
                              filterMatchMode="exact">
                        <f:facet name="header">
                            <h:outputText value="IsLock"/>
                        </f:facet>
                        <h:outputText value="#{item.isLock}"/>
                    </p:column>

                    <p:column sortBy="#{item.job.jobTitle}"
                              filterBy="#{item.job.jobTitle}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Job"/>
                        </f:facet>
                        <h:outputText value="#{item.job.jobTitle}"/>
                    </p:column>

               

                </p:dataTable>

            </p:dialog>
        </f:view>
    </h:form>
</html>
